<?php

use think\facade\Route;

Route::group('app_index/', function () {
    //-----------------------------【用户登录】-------------------------------
    //微信登录
    Route::post('login/getsessionkey', 'User/onWxSessionKey');

    Route::post('login/onLogin', 'User/onLogin');
    //获取手机验证码
    Route::post('login/getCode', 'User/getVerifyCode');
    //手机验证码登录
    Route::post('login/loginPhone', 'User/onLoginPhone');
    //更新用户基本信息
    Route::post('user/updateUserWx', 'User/onUpdateUserWx')->middleware(['auth']);


    //-----------------------------【用户登录】-------------------------------
    //【通用上传】
    Route::post('api/file/upload', 'Index/onUpload');
    //【OSS 签名】
    Route::get('api/file/ossSts', 'Index/onOssSts');

    //------------------------------【首页】-------------------------------
    //【Banner】
    Route::get('banner/all', 'Index/getBannerPage');
    //banner详情
    Route::get('banner/detail', 'Index/getBannerDetail');
    //【首页列表数据】
    Route::get('index/list', 'Index/getList');
    //商品分类
    Route::get('index/type', 'Index/getTypePage');
    //商品分类 过期版
    Route::get('goods/type', 'Index/getTypePage');
    //热门搜索
    Route::get('index/hotKeyword', 'Index/getHotKeyword');
    //商品搜索
    Route::get('index/goodsSearch', 'Index/onGoodsSearch');
    //公司模块数据获取
    Route::get('index/getCompanyInfo', 'Index/getCompanyInfo');
    //获取文章列表
    Route::get('index/getArticleList', 'Index/getArticleList');
    //图文动态详情
    Route::get('index/newDetail', 'Index/getNewDetail');
    //首页导航
    Route::get('index/getLabel', 'Index/getLabel');
    //县长推荐首页列表
    Route::get('index/getLeadership', 'Index/getLeadership');
    //县长推荐栏目列表
    Route::get('index/getLeadershipList', 'Index/getLeadershipList');
    //县长推荐详情
    Route::get('index/getLeadershipDetails', 'Index/getLeadershipDetails');
    //获取店铺导航
    Route::get('index/getStoreLabel', 'Index/getStoreLabel');
    //获取用户协议
    Route::get('index/getProtocol', 'Index/getProtocol');
    //------------------------------【首页】end-------------------------------

    //-------------------------------【图文信息】---------------------------------
    //图文导航
    Route::get('article/navList', 'Article/getNavList');
    //图文列表
    Route::get('article/articleList', 'Article/getArticleList');
    //图文详情
    Route::get('article/articleInfo', 'Article/getArticleInfo');

    //-------------------------------【图文信息】end---------------------------------

    //------------------------------【商品】-------------------------------------
    //商品详情
    Route::get('goods/detail', 'Goods/getDetail');
//    //活动商品列表
//    Route::get('goods/activityList', 'Goods/getActivityList');
//    //活动商品导航列表
//    Route::get('goods/activityLabel', 'Goods/getActivityLabel');
    //分享次数加一
    Route::post('goods/shareAdd', 'Goods/onShareAdd');
    //创建推广图片
    Route::post('goods/createQRcode', 'Goods/onCreateQRcode');
    //获取商品一级分类
    Route::get("goods/getTypeFirst", "Goods/getTypeFirst");
    //获取商品二级分类
    Route::get("goods/getTypeSecond", "Goods/getTypeSecond");
    //获取商品购买清单
    Route::get("goods/getGoodsInventory", "Goods/getGoodsInventory");

    //------------------------------【商品】-------------------------------------

    //----------------------------------【订单】-------------------------------------
    //商品展示-未生成订单
    Route::post('order/show', 'Order/onOrderShow')->middleware(['auth']);
    //商品展示-生成订单
    Route::post('order/create', 'Order/onCreateOrder')->middleware(['auth']);
    //----------------------------------【订单】end -------------------------------------

    //---------------------------【用户地址列表】-----------------------------------------
    Route::get('user/addressList', 'UserAddress/UserAddressList')->middleware(['auth']);
    Route::post('user/addressSave', 'UserAddress/UserAddressSave')->middleware(['auth']);
    Route::get('user/addressOne', 'UserAddress/UserAddressOne')->middleware(['auth']);
    Route::post('user/addressDelete', 'UserAddress/UserAddressDelete')->middleware(['auth']);
    //---------------------------【用户地址列表】end-----------------------------------------

    //-----------------------------【点赞收藏】--------------------------------------------
    //用户收藏点赞
    Route::post('user/collectOrUp', 'UserCollect/onUserCollectOrUp')->middleware(['auth']);
    //商品点赞收藏
    Route::post('user/upOrCollect', 'UserCollect/onGoodsUpOrCollect')->middleware(['auth']);

    //-----------------------------【点赞收藏】end--------------------------------------------

    //---------------------------【用户基本信息】--------------------------------------------------
    //个人中心
    Route::post('user/core', 'User/onUserCore');
    //获取 积分 --收益  规则
    Route::get('user/getRule', 'User/getRule');

    //获取佣金情况
    Route::get('user/getUserMoney', 'User/getUserMoney')->middleware(['auth']);

    //用户积分记录
    Route::post('user/userBalanceLog', 'User/onUserBalanceLog')->middleware(['auth']);
    //用户积分记录
    Route::post('user/integral', 'User/onUserIntegral')->middleware(['auth']);
    //绑定推广
    Route::post('user/userTop', 'User/onUserTop')->middleware(['auth']);
    //获取推广用户列表
    Route::post('user/userPopList', 'User/getUserPopList')->middleware(['auth']);
    //用户收益记录
    Route::post('user/earnings', 'User/onUserEarnings')->middleware(['auth']);
    //用户收益提现
    Route::post('user/earningExtract', 'User/onUserEarningsExtract')->middleware(['auth']);
    //vip
    Route::get('user/vipList', 'User/getUserVip');
    //获取物流
    Route::get('user/getLogisticsList', 'User/getLogisticsList');
    //意见反馈
    Route::post('user/suggest', 'User/onSuggest');
    //申请成为推广员
    Route::post('user/market', 'User/onMarket');
    //获取申请成为推广员信息
    Route::post('user/getMarket', 'User/getMarket');
    //商家申请入驻
    Route::post('user/settled', 'User/onSettled');
    //获取商家申请入驻信息
    Route::post('user/getSettled', 'User/getSettled');
    //商家缴纳保证金
    Route::post('user/storeDeposit', 'User/storeDeposit');

    //申请成为会员
    Route::post('user/member', 'User/onMember');
    //获取申请成为会员信息
    Route::post('user/getMember', 'User/getMember');
    //提交商家认证信息
    Route::post("user/addBusiness", "User/addBusiness")->middleware(['auth']);;
    //获取商家认证信息
    Route::get("user/getBusiness", "User/getBusiness")->middleware(['auth']);;

    //---------------------------【用户基本信息】end--------------------------------------------------

    //---------------------------------【购物车】-----------------------------------------------
    //加入购物车
    Route::post('user/addCart', 'UserCart/onAddCart')->middleware(['auth']);
    //我的购物车
    Route::post('user/myCart', 'UserCart/onCartList');
    //修改我的购物车
    Route::post('user/cartEdit', 'UserCart/onCartEdit')->middleware(['auth']);
    //删除我的购物车
    Route::post('user/cartDelete', 'UserCart/onCartDelete')->middleware(['auth']);
    //设置公益弹窗用户的选择
    Route::get('user/setPublicType', 'UserCart/setPublicType')->middleware(['auth']);
    //---------------------------------【购物车】end-----------------------------------------------

    //----------------------------------【支付信息】-------------------------------------------
    //支付信息展示
    Route::post('pay/orderShow', 'Pay/onPayOrderShow')->middleware(['auth']);
    //确认支付
    Route::post('pay/confirm', 'Pay/onConfirmPay')->middleware(['auth']);
    //查询支付
    Route::get('pay/payQuery', 'Pay/payQuery');
    //----------------------------------【支付信息】end-------------------------------------------

    //-----------------------------------【用户订单】--------------------------------------
    //用户订单
    Route::get('user/orderList', 'Order/getOrderList')->middleware(['auth']);
    //取消订单
    Route::post('user/cancelOrder', 'Order/onCancelOrder')->middleware(['auth']);
    //申请退货退款
    Route::post('user/outOrder', 'Order/onOutOrder')->middleware(['auth']);
    //获取订单详情
    Route::post('user/orderDetail', 'Order/getOrderDetail')->middleware(['auth']);
    //确认收货
    Route::post('user/confirmTake', 'Order/onConfirmTake')->middleware(['auth']);
    //订单物流
    Route::post('user/orderLogistics', 'Order/onOrderLogistics')->middleware(['auth']);
    //用户订单消费统计
    Route::post('user/getOrderStatistics', 'Order/getOrderStatistics')->middleware(['auth']);
    //用户设置退货物流
    Route::post('user/orderOutLogistics', 'Order/onOrderOutLogistics')->middleware(['auth']);
    //-----------------------------------【用户订单】end--------------------------------------

    //------------------------------【任务】----------------------------------
    Route::get('task/list', 'Task/getData');
    //------------------------------【任务】end----------------------------------

    //-----------------------------------【商家】---------------------------------
    //商家中心
    Route::post('agency/core', 'Agency/onCore')->middleware(['auth']);
    //获取文章详情
    Route::get('agency/article', 'Agency/getArticle')->middleware(['auth']);
    //收益
    Route::post('agency/earnings', 'Agency/onEarnings')->middleware(['auth']);
    //库存和待发货
    Route::post('agency/stores', 'Agency/onStores')->middleware(['auth']);
    //设置物流
    Route::post('agency/logistics', 'Agency/onLogistics')->middleware(['auth']);
    //获取物流订单列表
    Route::post('agency/agentGetLogistics', 'Agency/onAgentGetLogistics')->middleware(['auth']);
    //代理商转单给平台
    Route::post('agency/careSystem', 'Agency/onCareSystem')->middleware(['auth']);
    //获取物流公司信息
    Route::get('agency/logisticsList', 'Agency/onLogisticsList')->middleware(['auth']);
    //订单列表
    Route::post('agency/orderList', 'Agency/onOrderList')->middleware(['auth']);
    //发货订单详情
    Route::post('agency/orderSendDetail', 'Agency/onOrderSendDetail')->middleware(['auth']);
    //代理商待发货商品列表
    Route::post('agency/agentSendItem', 'Agency/onAgentSendItem')->middleware(['auth']);
    //代理商订单详情
    Route::post('agency/orderDetail', 'Agency/onOrderDetail')->middleware(['auth']);
    //退换订单列表
    Route::post('agency/outOrderList', 'Agency/onOutOrderList')->middleware(['auth']);
    //退换订单处理
    Route::post('agency/outOrderHandle', 'Agency/onOutOrderHandle')->middleware(['auth']);
    //订单展示
    Route::post('agency/agencyOrderShow', 'Agency/onAgencyOrderShow')->middleware(['auth']);
    //代理商申请提现
    Route::post('agency/earningsExtract', 'Agency/onEarningsExtract')->middleware(['auth']);
    //进货订单创建
    Route::post('agency/agencyOrderCreate', 'Agency/onAgencyOrderCreate')->middleware(['auth']);
    //进货单列表
    Route::post('agency/agencyOrderList', 'Agency/onAgencyOrderList')->middleware(['auth']);
    //进货单列表-取消
    Route::post('agency/agencyOrderCancel', 'Agency/onAgencyOrderCancel')->middleware(['auth']);
    //代理商客户列表
    Route::post('agency/agencyUserList', 'Agency/onAgencyUserList')->middleware(['auth']);
    //代理商设置代理用户备注
    Route::post('agency/setUserRemark', 'Agency/onSetUserRemark')->middleware(['auth']);
    //代理商绑定新的代理用户
    Route::post('agency/addAgencyUser', 'Agency/onAddAgencyUser')->middleware(['auth']);
    //-----------------------------------【商家】end---------------------------------

    //------------------------------------【趣豆商城】-----------------------------------
    //回去趣豆商城分类列表
    Route::get("game/goodsType", "Game/onGoodsType")->middleware(['auth']);
    //回去趣豆商城商品列表
    Route::get("game/goodsIndex", "Game/onGoodsIndex")->middleware(['auth']);
    //趣豆礼包商品
    Route::get("game/goodsGift", "Game/onGoodsGift")->middleware(['auth']);
    //盲盒中心
    Route::get("game/getGameCore", "Game/getGameCore")->middleware(['auth']);
    //参与盲盒
    Route::get("game/joinGameProcess", "Game/joinGameProcess")->middleware(['auth']);
    //主动开奖
    Route::get("game/openGameProcess", "Game/openGameProcess")->middleware(['auth']);
    //获取我的卡片
    Route::get("game/getGameCardList", "Game/getGameCardList")->middleware(['auth']);
    //获取我的商品兑换券
    Route::get("game/getCouponList", "Game/getCouponList")->middleware(['auth']);
    //开启卡片、礼盒
    Route::get("game/openGameCard", "Game/openGameCard")->middleware(['auth']);
    //合成礼盒
    Route::get("game/comGameCard", "Game/comGameCard")->middleware(['auth']);
    //获取开奖记录
    Route::get("game/getGameRecord", "Game/getGameRecord")->middleware(['auth']);
    //获取趣豆记录
    Route::get("game/getUserBean", "Game/getUserBean")->middleware(['auth']);
    //趣豆收益累计数据【过期】
    Route::get("game/getUserTotalBean", "Game/getUserTotalBean")->middleware(['auth']);
    //趣豆累计统计数据
    Route::get("game/getUserStatisticsBean", "Game/getUserStatisticsBean")->middleware(['auth']);
    //趣豆收益明细汇总
    Route::get("game/getUserTotalBeanPage", "Game/getUserTotalBeanPage")->middleware(['auth']);
    //趣豆提现
    Route::get("game/userBeanExtract", "Game/userBeanExtract")->middleware(['auth']);
    //------------------------------------【趣豆商城】end-----------------------------------


})->prefix('api.')->middleware(['token']);
